<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/1/13
  Time: 19:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>自定义分页</title>
</head>
<body>
  <table border="1">
    <thead>
      <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>工资</th>
        <th>部门编号</th>
      </tr>
    </thead>
    <tbody>
      <c:forEach items="${list}" var="e">
        <tr>
          <td>${e.id}</td>
          <td>${e.empName}</td>
          <td>${e.gender}</td>
          <td>${e.salary}</td>
          <td>${e.deptid}</td>
        </tr>
      </c:forEach>
    </tbody>
  </table>

  <a href="/custom?pagenum=${page.first}&pagesize=${page.pageSize}">首页</a>
  <a href="/custom?pagenum=${page.prev}&pagesize=${page.pageSize}">上一页</a>

  <c:forEach items="${page.numText}" var="n">
    <c:if test="${ellipsis eq n}">
      ${n}
    </c:if>
    <c:if test="${ellipsis} ne n">
      <a href="/custom?pagenum=${n}&pagesize=${page.pageSize}">${n}</a>
    </c:if>
  </c:forEach>

  <a href="/custom?pagenum=${page.next}&pagesize=${page.pageSize}">下一页</a>
  <a href="/custom?pagenum=${page.last}&pagesize=${page.pageSize}">尾页</a>
</body>
</html>
